1. Field of the Invention
This invention relates to an image compressing apparatus, such as an image compressing apparatus having an orthogonal transformation function, and to the method of image compression used therein.
2. Description of the Related Art
The memory capacity necessary for storing a full color image (hereinafter referred to as an xe2x80x9cimagexe2x80x9d) such as a photograph in a memory is calculated by multiplying the number of pixels by the number of tone bits. This makes necessary an enormous memory capacity in order to store such a high-quality color image. For this reason, a variety of methods of compressing the amount of information have been proposed. For example, attempts have been made to reduce the required memory capacity by first compressing the image information and then storing the compressed information in memory.
FIG. 1 is a block diagram showing the coding method (see xe2x80x9cInternational Standardization for Color Photographic Codingxe2x80x9d, Hiroshi Yasuda, The Journal of the Institute of Image Electronics Engineers of Japan, Vol. 18, No. 6, pp. 398-407, 1989) of a baseline system proposed by the JPEG (Joint Photographic Experts Group) as a method of achieving international standardization of color still-picture coding.
As shown in FIG. 1, pixel data entered from an input terminal 1 is cut into 8xc3x978 pixel blocks in a block forming circuit 2, the data is subjected to a cosine transformation by a discrete cosine transformation (hereinafter referred to as xe2x80x9cDCTxe2x80x9d) circuit 17, and the transformation coefficients obtained by the transformation are supplied to a quantization (hereinafter referred to as xe2x80x9cQxe2x80x9d) unit 40. In accordance with quantization-step information supplied by a quantization table 41, the Q unit 40 subjects the transformation coefficients to linear quantization. Of the quantized transformation coefficients, a DC coefficient is applied to a predictive coding circuit [hereinafter referred to as a xe2x80x9cDPCM (differential pulse-coded modulation) circuitxe2x80x9d] 42, which obtains the differential (a prediction error) between this DC coefficient and the DC component of the preceding block. The difference is applied to a one-dimensional Huffman coding circuit 43.
FIG. 2 is a block diagram showing the details of the DPCM 42. The quantized DC coefficient from the Q unit 40 is applied to a delay circuit 53 and a subtracter 54. The delay circuit 53 applies a delay equivalent to the time needed for the discrete cosine transformation circuit to operate on one block, namely 8xc3x978 pixels. Accordingly, the delay circuit 53 supplies the subtracter 54 with the DC coefficient of the preceding block. As a result, the subtracter 54 outputs the differential (prediction error) between the DC coefficient of the current block and that of the preceding block. In this predictive coding, the value of the preceding block is used as the prediction value, and therefore the predicting unit is constituted by the delay circuit, as set forth above.
In accordance with a DC Huffman code table 44, the one-dimensional Huffman coding circuit 43 applies variable-length coding to the prediction error signal supplied by the DPCM 42 and supplies a multiplexer 51 with the data, i.e., a DC Huffman code, that has been variable-length coded.
An AC coefficient (a coefficient other than the DC coefficient) quantized by the Q unit 40 is zigzag-scanned in order from coefficients of lower order, as shown in FIG. 3, by means of a scan converting circuit 45, and the output of the scan converting circuit 45 is applied to a significant-coefficient detector circuit 46. The latter determines whether the quantized AC coefficient is xe2x80x9c0xe2x80x9d or not. If the AC coefficient is xe2x80x9c0xe2x80x9d, a count-up signal is supplied to a run-length counter 47, thereby incrementing the counter. If the coefficient is xe2x80x9c1xe2x80x9d, however, a reset signal is applied to the run-length counter 47 to reset the counter, and the coefficient is split into a group number SSSS and annexed bits, as shown in FIG. 4, by a grouping circuit 48. The group number SSSS is supplied to a two-dimensional Huffman coding circuit 49, and the annexed bits are supplied to the multiplexer 51. The run-length counter 47 counts a xe2x80x9c0xe2x80x9d run length and supplies the two-dimensional Huffman coding circuit 49 with the number NNNN of consecutive xe2x80x9c0xe2x80x9d between significant coefficients other than xe2x80x9c0xe2x80x9d. In accordance with the AC Huffman code table 50, the Huffman coding circuit 49 applies variable-length coding to the xe2x80x9c0xe2x80x9d run length NNNN and the significant-coefficient group number SSSS of significant coefficients and supplies the multiplexer 51 with the data, i.e., an AC Huffman code, that has been variable-length coded.
The multiplexer 51 multiplexes the DC Huffman code, AC Huffman code and annexed bits of one block (8xc3x978 input pixels) and outputs the multiplexed data, namely compressed image data, from its output terminal 52. Accordingly, the compressed data outputted by the output terminal 52 is stored in a memory, and at read-out the data is expanded by a reverse operation, thereby making it possible to reduce memory capacity.
However, the example of the prior art described above has a disadvantage. For example, consider application of the prior art to an image output unit. In general, an image output unit often is connected to an image input unit such as a host computer or image scanner and operates as part of a system. In such case, various images, such as computer graphics produced by the host computer or images inputted from the image scanner are sent to the image output unit.
The prior art described above is such that a deterioration in image quality is suppressed in an image of the kind in which the transformation coefficients concentrate in the low region of the orthogonal transformation, as in an image obtained by digitizing an image such as a photograph by an image scanner. However, in artificially created images such as computer graphics, font images and images resulting from computer-aided design, images that have been compressed and then restored by expansion experience a major deterioration in quality.
Though means has been proposed in U.S. patent application Ser. No. 07/738,562 by the same assignee as this case for changing over the quantization conditions adaptively depending upon the level of transformation coefficients, this proposal also possesses a drawback. Specifically, since a sampled image is dealt with as an input source, the arrangement is such that the sensed portion of the image is distinguished as being an edge portion or a flat portion of the image on the basis of the transformation coefficients. The input source, i.e., the sampled image, which has entered from a device such as an image scanner is outputted as an image in which edge portions are weakened, no matter how significant the edge portions are in the original, owing to the characteristics of the MTF (modulation transmission function) of the image scanner. Consequently, image quality will not be affected that much even if the high-frequency components within a block are quantized coarsely to a small degree. However, an artificially produced image often contains strong AC power in high-frequency components which do not occur at the edge portions of an image inputted by a device such as an image scanner, namely an image having ordinary low to intermediate resolution. When the conventional coarse quantization is applied to these images, deleterious effects become conspicuous, such as the interruption of artificially produced fine lines and the occurrence of noise such as ringing in flat portions in the vicinity of fine lines. In addition, a simple method which involves little time loss has not been proposed with regard to the requirements for changing over the quantization conditions based upon the transformation coefficients.
The prior art described has the following drawbacks as well.
A half-tone image obtained by inputting an original such as a photograph using a device such as an image scanner tends to have its coefficients concentrated in the low-frequency region of the orthogonally transformed block, and therefore the occurrence of significant coefficients concentrates in the relatively lower orders so that the higher orders often are all consecutive
In this case, when the xe2x80x9c0xe2x80x9d run is 16 or greater, an xe2x80x9cR16xe2x80x9d code is allocated, as shown in FIG. 4, and a xe2x80x9c0xe2x80x9d run counter is reset after the code is transmitted so that the run length of xe2x80x9c0xe2x80x9d is counted again. When a significant coefficient other than xe2x80x9c0xe2x80x9d is subsequently generated, two-dimensional Huffman coding is performed using this significant coefficient and the run length of xe2x80x9c0xe2x80x9ds which continue up to this coefficient.
Consequently, in zigzag scanning of the kind shown in FIG. 3, in which scanning is performed sequentially from lower order coefficients, the art is such that even if the occurrence of significant coefficients ends midway, whether or not significant coefficients have occurred in the subsequent higher order coefficients is unknown, and therefore preparations must be made for coding of xe2x80x9cR16xe2x80x9d by counting the number of xe2x80x9c0xe2x80x9d every coefficient. More specifically, in sequential zigzag scanning from the lower order coefficients, it cannot be ascertained up to what point the significant coefficients other than xe2x80x9c0xe2x80x9d have been generated, i.e., up to what point coding should be performed, unless scanning is carried out up to the highest order coefficient one time. In a case where the highest order coefficient is a coefficient other than xe2x80x9c0xe2x80x9d, the coding of R16 and the coding of the ensuing xe2x80x9c0xe2x80x9d run must be performed if the xe2x80x9c0xe2x80x9d run is equal to or greater than 16, based on the run length of xe2x80x9c0xe2x80x9d stored thus far. In a case where the highest order coefficient also is xe2x80x9c0xe2x80x9d, the xe2x80x9c0xe2x80x9d run stored thus far is reset and an xe2x80x9cEOBxe2x80x9d (end of block) code (shown in FIG. 4) must be generated. That is, there are cases where the time required for coding within a block changes at the end. In other words, coding cannot be performed within a fixed time period every time.
An object of the present invention is to provide an image compressing apparatus that is capable of eliminating the aforementioned drawbacks of the prior art described above.
Another object of the present invention is to provide an image compressing apparatus in which the edges of such artificially created images as characters, fonts and line drawings can be outputted in excellent fashion and suitable quantization can be realized by a simple arrangement regardless of the input source from which an image is received.
Still another object of the present invention is to provide an image compressing apparatus in which coding can be performed in a predetermined period of time regardless of the kind of information within a block, and in which the circuitry can be constructed inexpensively and in simple fashion.
One aspect of the present invention provides an image compressing apparatus comprising input means for inputting a plurality of spatial frequency component data in a predetermined block, quantizing means for quantizing the spatial frequency component data in accordance with one quantizing method from among a plurality of different quantizing methods, discriminating means for discriminating an image type by comparing each of the spatial frequency component data with a predetermined value, and selecting means for selecting one quantizing method from among said plurality of different quantizing methods in accordance with the discrimination made by said discriminating means.
A further aspect of the present invention provide an image compressing method comprising steps of inputting a plurality of spatial frequency component date in a predetermined block, discriminating an image type by comparing each of the spatial frequency component data with a predetermined value, and selecting one quantizing method from among a plurality of different quantizing method in accordance with the discrimination, quantizing the spatial frequency component data in accordance with the quantizing method selected from among the plurality of different quantizing methods.
A further aspect of the present invention provide an image processing apparatus comprising first read-out means for reading-out information, which is obtained by orthogonally transforming a multivalued image signal, from a high-frequency component to a low-frequency component in block units, second read-out means for reading-out the information, which has been obtained by the orthogonal transformation, from the low-frequency component to the high-frequency component in block units, and selecting means for selecting said first read-out means or said second read-out means in block units.
A further aspect of the present invention provides an image processing method comprising steps of first read-out step for reading-out information, which is obtained by orthogonally transforming a multivalued image signal, from a high-frequency component to a low-frequency component in block units, second read-out step for reading-out the information, which has been obtained by the orthogonal transformation, from the low-frequency component to the high-frequency component in block units, and repeating step for repeating said first and second step.
A further object of the present invention is to provide an image compressing apparatus in which image compression can be performed efficiently with high speed.
A further object of the present invention is to provide a multivalued image compressing apparatus for generally use.
A further object of the present invention is to improve hardware for variable-length coding.
A further object of the present invention is to provide an apparatus in which deterioration in image quality can be reduced.
Other features and advantages of the present invention will be apparent from the following description taken in conjunction with the accompanying drawings, in which like reference characters designate the same or similar parts throughout the figures thereof.